package edu.pku.sei.transformation.mtparser;

import lpg.runtime.*;

/**
 *<b>
 *<li>Rule 15:  CommaExpr ::= Expression ; SingleExpr
 *</b>
 */
public class CommaExpr extends Ast implements ICommaExpr
{
    private IExpression _Expression;
    private ISingleExpr _SingleExpr;

    public IExpression getExpression() { return _Expression; }
    public ISingleExpr getSingleExpr() { return _SingleExpr; }

    public CommaExpr(IToken leftIToken, IToken rightIToken,
                     IExpression _Expression,
                     ISingleExpr _SingleExpr)
    {
        super(leftIToken, rightIToken);

        this._Expression = _Expression;
        this._SingleExpr = _SingleExpr;
        initialize();
    }

    public boolean equals(Object o)
    {
        if (o == this) return true;
        if (! (o instanceof CommaExpr)) return false;
        if (! super.equals(o)) return false;
        CommaExpr other = (CommaExpr) o;
        if (! _Expression.equals(other._Expression)) return false;
        if (! _SingleExpr.equals(other._SingleExpr)) return false;
        return true;
    }

    public int hashCode()
    {
        int hash = super.hashCode();
        hash = hash * 31 + (_Expression.hashCode());
        hash = hash * 31 + (_SingleExpr.hashCode());
        return hash;
    }

    public void accept(Visitor v) { v.visit(this); }
    public void accept(ArgumentVisitor v, Object o) { v.visit(this, o); }
    public Object accept(ResultVisitor v) { return v.visit(this); }
    public Object accept(ResultArgumentVisitor v, Object o) { return v.visit(this, o); }
}


